'## Copyright (c) 2011, Hacker Wez under the New BSD License, see glyphx-license.txt (http://glyphx.codeplex.com/)
Public Class footprint

    Public Property Index() As Integer
        Get
            Return _Index
        End Get
        Set(ByVal value As Integer)
            _Index = value
        End Set
    End Property
    Private _Index As Integer

    Public Property X() As Integer
        Get
            Return _X
        End Get
        Set(ByVal value As Integer)
            _X = value
        End Set
    End Property
    Private _X As Integer

    Public Property Y() As Integer
        Get
            Return _Y
        End Get
        Set(ByVal value As Integer)
            _Y = value
        End Set
    End Property
    Private _Y As Integer

    Public Property Decay() As Integer
        Get
            Return _Decay
        End Get
        Set(ByVal value As Integer)
            _Decay = value
        End Set
    End Property
    Private _Decay As Integer

    Public Property Life() As Integer
        Get
            Return _Life
        End Get
        Set(ByVal value As Integer)
            _Life = value
        End Set
    End Property
    Private _Life As Integer

    Function IsAlive() As Boolean
        Life -= Decay
        Return (Life > 0)
    End Function

    Function ToDestPoint() As Drawing.Point
        Return New Drawing.Point(Me.X, Me.Y)
    End Function

    Function ToSourceRect() As Drawing.Rectangle
        Return New Drawing.Rectangle(Me.Index * GLYPH_SPRITE_SIZE, 0, GLYPH_SPRITE_SIZE, GLYPH_SPRITE_SIZE)
    End Function

    Function ToBlurSourceRect() As Drawing.Rectangle
        Return New Drawing.Rectangle(Me.Index * GLYPH_SPRITE_SIZE, GLYPH_SPRITE_SIZE, GLYPH_SPRITE_SIZE, GLYPH_SPRITE_SIZE)
    End Function

End Class
